var obj = {
	do_something: do_something,
	obj: {
		do_something: do_something,
		obj: {
			do_something: do_something,
			obj: {
				do_something: do_something,
				obj: {
					do_something: do_something,
					obj: {
						do_something: do_something,
						obj: {
							do_something: do_something,
							obj: {
								do_something: do_something,
								obj: {
									do_something: do_something,
									obj: {
										do_something: do_something
									}
								}
							}
						}
					}
				}
			}
		}
	}
};

silobox({
    title: "Deeply nested objects",
    description: "Tests accessing different levels inside an object",
    reps: 10,
    iterations: 300,
	testdelay: 2000,
    tests: [{
    	title: "Cached 1 level",
    	description: "Cached accessing deep nested object - 1 level (no nesting)",
    	code: function(){
    		
    		var i = 1000;
    		var cache = obj.do_something;
    		while (i--) {
    			cache();
    		}	
    		
    	}
    },
    {
    	title: "Cached 2 levels",
    	description: "Cached accessing deep nested object - 2 levels",
    	code: function(){
    		
    		var i = 1000;
    		var cache = obj.obj.do_something;
    		while (i--) {
    			cache();
    		}	
    		
    	}
    },
    {
    	title: "Cached 3 levels",
    	description: "Cached accessing deep nested object - 3 levels",
    	code: function(){
    		
    		var i = 1000;
    		var cache = obj.obj.obj.do_something;
    		while (i--) {
    			cache();
    		}	
    		
    	}
    },
    {
    	title: "Cached 4 levels",
    	description: "Cached accessing deep nested object - 4 levels",
    	code: function(){
    		
    		var i = 1000;
    		var cache = obj.obj.obj.obj.do_something;
    		while (i--) {
    			cache();
    		}	
    		
    	}
    },
    {
    	title: "Cached 5 levels",
    	description: "Cached accessing deep nested object - 5 levels",
    	code: function(){
    		
    		var i = 1000;
    		var cache = obj.obj.obj.obj.obj.do_something;
    		while (i--) {
    			cache();
    		}	
    		
    	}
    },
    {
    	title: "Cached 6 levels",
    	description: "Cached accessing deep nested object - 6 levels",
    	code: function(){
    		
    		var i = 1000;
    		var cache = obj.obj.obj.obj.obj.obj.do_something;
    		while (i--) {
    			cache();
    		}	
    		
    	}
    },
    {
    	title: "Cached 7 levels",
    	description: "Cached accessing deep nested object - 7 levels",
    	code: function(){
    		
    		var i = 1000;
    		var cache = obj.obj.obj.obj.obj.obj.obj.do_something;
    		while (i--) {
    			cache();
    		}	
    		
    	}
    },
    {
    	title: "Cached 8 levels",
    	description: "Cached accessing deep nested object - 8 levels",
    	code: function(){
    		
    		var i = 1000;
    		var cache = obj.obj.obj.obj.obj.obj.obj.obj.do_something;
    		while (i--) {
    			cache();
    		}	
    		
    	}
    },
    {
    	title: "Cached 9 levels",
    	description: "Cached accessing deep nested object - 9 levels",
    	code: function(){
    		
    		var i = 1000;
    		var cache = obj.obj.obj.obj.obj.obj.obj.obj.obj.do_something;
    		while (i--) {
    			cache();
    		}	
    		
    	}
    },
    {
    	title: "Cached 10 levels",
    	description: "Cached accessing deep nested object - 10 levels",
    	code: function(){
    		
    		var i = 1000;
    		var cache = obj.obj.obj.obj.obj.obj.obj.obj.obj.obj.do_something;
    		while (i--) {
    			cache();
    		}
    		
    	}
    },
    {
    	title: "Non-cached 1 level",
    	description: "Non-cached accessing deep nested object - 1 level (no nesting)",
    	code: function(){
    		
    		var i = 1000;
    		while (i--) {
    			obj.do_something();
    		}	
    		
    	}
    },
    {
    	title: "Non-cached 2 levels",
    	description: "Non-cached accessing deep nested object - 2 levels ",
    	code: function(){
    		
    		var i = 1000;
    		while (i--) {
    			obj.obj.do_something();
    		}	
    		
    	}
    },
    {
    	title: "Non-cached 3 levels",
    	description: "Non-cached accessing deep nested object - 3 levels ",
    	code: function(){
    		
    		var i = 1000;
    		while (i--) {
    			obj.obj.obj.do_something();
    		}	
    		
    	}
    },
    {
    	title: "Non-cached 4 levels",
    	description: "Non-cached accessing deep nested object - 4 levels ",
    	code: function(){
    		
    		var i = 1000;
    		while (i--) {
    			obj.obj.obj.obj.do_something();
    		}	
    		
    	}
    },
    {
    	title: "Non-cached 5 levels",
    	description: "Non-cached accessing deep nested object - 5 levels ",
    	code: function(){
    		
    		var i = 1000;
    		while (i--) {
    			obj.obj.obj.obj.obj.do_something();
    		}	
    		
    	}
    },
    {
    	title: "Non-cached 6 levels",
    	description: "Non-cached accessing deep nested object - 6 levels ",
    	code: function(){
    		
    		var i = 1000;
    		while (i--) {
    			obj.obj.obj.obj.obj.obj.do_something();
    		}	
    		
    	}
    },
    {
    	title: "Non-cached 7 levels",
    	description: "Non-cached accessing deep nested object - 7 levels ",
    	code: function(){
    		
    		var i = 1000;
    		while (i--) {
    			obj.obj.obj.obj.obj.obj.obj.do_something();
    		}	
    		
    	}
    },
    {
    	title: "Non-cached 8 levels",
    	description: "Non-cached accessing deep nested object - 8 levels ",
    	code: function(){
    		
    		var i = 1000;
    		while (i--) {
    			obj.obj.obj.obj.obj.obj.obj.obj.do_something();
    		}	
    		
    	}
    },
    {
    	title: "Non-cached 9 levels",
    	description: "Non-cached accessing deep nested object - 9 levels ",
    	code: function(){
    		
    		var i = 1000;
    		while (i--) {
    			obj.obj.obj.obj.obj.obj.obj.obj.obj.do_something();
    		}	
    		
    	}
    },
    {
    	title: "Non-cached 10 levels",
    	description: "Non-cached accessing deep nested object - 10 levels ",
    	code: function(){
    		
    		var i = 1000;
    		while (i--) {
    			obj.obj.obj.obj.obj.obj.obj.obj.obj.obj.do_something();
    		}	
    		
    	}
    }
    ]
});